﻿@using PagedList
@using PagedList.Mvc
@model IPagedList<KhatVongViet.Models.Member>
@{
    ViewBag.Title = "Khát Vọng Việt - Thành Viên";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div style="border-left: 1px dashed #ccc; float: left">
    <div class="div-title-r">
        <div class="div-title-text">
            Thành viên / Trang @ViewBag.Page
        </div>
    </div>
    <div class="div-title-end">
        <div class="div-title-end-peace">
            <img src="../../Content/images/top-title-image-r.png" />
        </div>
        <div class="div-title-end-peace">
            <img src="../../Content/images/bot-title-image-r.png" />
        </div>
    </div>
    <br />
    <br />
    <br />
    @for (int i = ViewBag.NumberItemPerPage * ViewBag.Page - ViewBag.NumberItemPerPage; i < ViewBag.NumberMember && i < ViewBag.NumberItemPerPage * ViewBag.Page; i++)
    {
        <div class="box-confession-alldetail-peaces">
            <div class="box-image-cxv">
                <img src=@ViewBag.ListMember[i].Photo />
            </div>
            <div class="box-camxucviet-title">
                <a class="titlelink" href="/Manage/DetailMember?memberId=@ViewBag.ListMember[i].ID">
                    @ViewBag.ListMember[i].Name</a>
            </div>
            <div class="box-camxucviet-detail">
                @if (ViewBag.ListMember[i].Summary != null)
                {
                    if (ViewBag.ListMember[i].Summary.Length <= 300)
                    {
                    @ViewBag.ListMember[i].Summary
                    }
                    else
                    {
                    @ViewBag.ListMember[i].Summary.Substring(0, ViewBag.ListMember[i].Summary.Substring(0, 300).LastIndexOf(" "))
                    }
                }
            </div>
        </div>
    }
    <div class="PagedList">
        @Html.PagedListPager(Model, page => Url.Action("MemberPage", "Manage", new { ViewBag.id, page }), PagedListRenderOptions.OnlyShowFivePagesAtATime)
    </div>
</div>
